<include file="public@header" />
</head>
<body>

<!--单位用户积分排行榜-->

<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a >列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('ranking/user')}">

        类型：
        <select class="form-control" name="partybranch">
            <option value="">全部</option>
            <volist name="partybranchs" id="v">
                <option value="{$key}" <if condition="input('request.partybranch') neq '' && input('request.partybranch') eq $key">selected</if>>{$v}</option>
            </volist>
        </select>
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('ranking/user')}">清空</a>
        <a class="btn btn-success exportranking" href="{:url('ranking/exportuser',['partybranch' => 0])}">导出排行榜</a>
    </form>
    <form method="post" class="js-ajax-form" action="">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>ID</th>
                <th>昵称</th>
                <th>积分</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo['id']}</td>
                    <td>{$vo['user_nickname']}</td>
                    <td>{$vo['score']}</td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>

    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">

    $("select[name='partybranch']").change(function () {
       var val = $(this).val();
       var newhref = "/admin/ranking/exportuser/partybranch/" + val + ".html";
       $(".exportranking").attr("href", newhref);

    });


</script>


</body>
</html>